package com.lianbang.pharmacy.module.user

import android.app.Activity
import android.content.Context
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView

import com.lianbang.pharmacy.R
import cn.ubest.mvvmcore.base.BaseActivity
import cn.ubest.mvvmcore.base.BaseListActivity
import cn.ubest.mvvmcore.databinding.IncludeToolbarListWithRefreshBinding
import com.chad.library.adapter.base.BaseQuickAdapter
import com.lianbang.pharmacy.adapter.CouponCenterListAdapter
import com.lianbang.pharmacy.databinding.ActivityMyScoreBinding
import com.lianbang.pharmacy.vm.CouponVM
import com.lianbang.pharmacy.vm.MainVM
import com.lianbang.pharmacy.vm.UserVM
import com.scwang.smart.refresh.layout.SmartRefreshLayout
import kotlinx.android.synthetic.main.activity_my_score.*

class CouponCenterActivity :
    BaseListActivity<MainVM, IncludeToolbarListWithRefreshBinding, String>() {

    companion object {
        fun start(context: Context?) {
            context?.also {
                val starter = Intent(it, CouponCenterActivity::class.java)
                if (it !is Activity) {
                    starter.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
                }
                it.startActivity(starter)
            }
        }
    }

    override fun initLayout(): Int {
        return R.layout.include_toolbar_list_with_refresh

    }

    override fun setToolbarTitle(): String? {
        return "领券中心"
    }

    override fun initData(intent: Intent) {
        super.initData(intent)
    }

    override fun initView() {
        super.initView()
    }

    override fun loadData() {
        mViewModel.refreshData()
    }

    override fun initAdapter(): BaseQuickAdapter<String, *> {
        return CouponCenterListAdapter()
    }
}
